package com.cy.model;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

/**
 * @Author：小小微光
 * @Package：com.cy.model
 * @Project：Alian
 * @name：ImageData
 * @Date：2023/3/15 0015  20:38
 * @Filename：ImageData
 */
public class ImageData {
    public static BufferedImage beijingImage ; //背景
    public static BufferedImage image ;//图标
    public static BufferedImage heroImage1;
    public static BufferedImage heroImage2;
    public static BufferedImage alienImage;

    public static BufferedImage heroBulletImage;//英雄子弹

//使用静态代码块读取数据
    static {
    try {
        beijingImage = ImageIO.read(new File("images/bg1.jpg"));
        image = ImageIO.read(new File("images/alien2.png"));
        heroImage1 = ImageIO.read(new File("images/hero1_1.png"));
        heroImage2 = ImageIO.read(new File("images/hero1_2.png"));

        alienImage = ImageIO.read(new File("images/alien3.png"));

        heroBulletImage = ImageIO.read(new File("images/heroBullet1.png"));
    } catch (IOException e) {
        e.printStackTrace();
    }
    }
}
